package com.lmx.repoDomain.tmodel;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiLookupIncludeAutomatically;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToMany;
import io.katharsis.resource.annotations.JsonApiToOne;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.lmx.repoDomain.tmodel.business.User;

/**
 * 客户表
 */
@Entity
@Table(name = "tnb_customer")
@JsonApiResource(type = "customer")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Customer extends BaseEntity {
	private String name; // 客户名称
	private String phone;// 电话号码
	private String email;// 邮箱
	private String weixin;// 微信号
	private String address;// 地址
	private Integer birthday;// 生日
	private Integer age;// 年龄
	private String qq;// QQ
	private Short isAllocated;// 是否已分配 0 ：未分配 1：已分配
	private Integer createTime;// 创建时间
	private Integer updateTime;// 更新时间
	private String remark;// 备注
	private String extendInfo;// 扩展信息

	// 以下为添加字段
	private String accountMoney;// 实际账户余额

	private String actualDeposit;// 实际保证金

	private String actualPrice;// 总的实际价格

	private String bedMatID;// 床垫id

	private String referenceBedPrice;// 参考床位价格

	private String actualBedPrice;// 实际床位价格

	private String cardCodeScanning;// 身份证扫描件

	private Short changePriceFlag;// 此月是否更改价格

	private Integer checkInDate;// 入住时间

	private Integer checkOutDate;// 退房时间

	private Integer contractEndDate;// 合同结束日期

	private String contractNO;// 该合同编号 关联合同表

	private Integer contractStartDate;// 该合同开始日期

	private Integer countDate;// 生效日期

	private String cardCode;// 身份证

	private String customerCharacter;// 性格特点

	private String customerCustom;// 生活习惯

	private String customerDiet;// 饮食偏好

	private Dicttype firstRelation;// 与第一联系人关系

	private String customerHobby;// 个人爱好

	private String customerPS;// 身体状况

	private Dicttype secondRelation;//

	private Dicttype thirdRelation;

	private String deposit;// 押金金额

	private String referenceDiningPrice;// 参考餐饮价格

	private String actualDiningPrice;// 实际餐饮价格

	private Integer experienceDate;// 试住办理日期

	private String experienceEndDate;// 试住开始时间

	private String experienceStartDate;// 试住结束时间

	private String guardianFirstAddress;// 第一监护人地址

	private String guardianFirstCardCode;// 第一监护人身份证

	private String guardianFirstCardCodeScanning;// 第一监护人身份证扫描件

	private String guardianFirstContact;// 第一监护人电话

	private Dicttype guardianFirstGener;// 第一监护人性别

	private String guardianFirstName;// // 第一监护人姓名

	private String guardianFirstWork;// 第一监护人工作单位

	private String guardianSecondAddress;

	private String guardianSecondCardCode;

	private String guardianSecondCardCodeScanning;

	private String guardianSecondContact;

	private Dicttype guardianSecondGener;

	private String guardianSecondName;

	private String guardianSecondWork;

	private String guardianThirdAddress;

	private String guardianThirdCardCode;

	private String guardianThirdCardCodeScanning;

	private String guardianThirdContact;

	private Dicttype guardianThirdGener;

	private String guardianThirdName;

	private String guardianThirdWork;

	private String hbeaconID;// 手环id

	private String healthReportsScanning;// 健康报告扫描件

	private Dicttype incomeType;// 入住类型 1试住，2入住

	private Dicttype maritalStatus;// 婚姻状况

	private DicttypeTenant diningStandard;// 餐饮标准

	private Dicttype expenceType;// 付费类型

	private Dicttype bloodType;// 血型

	private Dicttype sex; // 性别,1男2女

	private Dicttype educationLevel;// 学历

	private Dicttype selfCareAbility;// 自理能力

	private Dicttype religion;// 宗教

	private Dicttype customerStatus;// 入住状态 退房 试住 入住

	private Dicttype nursingGrade;// 护理级别

	private User lastUpdateUser;// 更新user id关联user表id

	private User createUser;// 创建者user 关联user表id

	private Bed bed;// 床位编号 需要关联bed表 id

	private Dicttype nationality;// 民族

	private Dicttype customerNative;// 籍贯

	private String referenceNursingPrice;// 参考护理价格

	private String actualNursingPrice;// 实际护理价格

	private String referencePrice;// 总的参考价格

	private String selfCareAbilityResult;// 自理评估结果分数

	private String headImg;// //头像

	private String discountRate = null; // 折扣率

	private String etcommID;// 益体康卡id

	private Integer applyFlag;// 申请变更标识

	private String detailedInformation; // 各人详细情况

	private String tabooThing; // 忌讳的事

	private String importancePerson; // 重视的人

	private String importanceThing; // 重视的事

	private String qrCodeUrl;// 二维码地址

	private Dicttype customerBirthdayHabit; // 生日习惯

	private Dicttype medicalInsuranceCategory; // 医保类别

	private List<Dicttype> oldManType; // 老人类型 huibati

	private List<Employee> employees;// 所对应护工

	private List<CustomerDrug> drugs;

	private List<User> staffs;// 关注此老人的

	private List<HealthInfo> healthInfos; // 一个客户对应多张健康信息表

	private String addRemark;// 生成标识 直接增添

	private CustomerVipInfo customerVipInfo;

	private Town town;// 街道 镇

	private Dicttype incomeLevel;// 收入等级

	private Integer childrenNum;// 子女数目

	private Integer busInsuranceAmount;// 商保金额

	private Integer leaveStatus;// 老人是否在请假中

	private CustomerExtend customerExtend;

	private String flagRemark;
	private String nursingLevel;

	@Transient
	public String getFlagRemark() {
		return flagRemark;
	}

	public void setFlagRemark(String flagRemark) {
		this.flagRemark = flagRemark;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "town_id", foreignKey = @ForeignKey(name = "null"))
	public Town getTown() {
		return town;
	}

	public void setTown(Town town) {
		this.town = town;
	}

	@Column(name = "addRemark")
	public String getAddRemark() {
		return addRemark;
	}

	public void setAddRemark(String addRemark) {
		if (addRemark == null || "".equals(addRemark))
			addRemark = "normal";
		this.addRemark = addRemark;
	}

	@Column(name = "qrcode_url")
	public String getQrCodeUrl() {
		return qrCodeUrl;
	}

	public void setQrCodeUrl(String qrCodeUrl) {
		this.qrCodeUrl = qrCodeUrl;
	}

	@Column(name = "apply_flag")
	public Integer getApplyFlag() {
		return applyFlag;
	}

	public void setApplyFlag(Integer applyFlag) {
		if (applyFlag == null)
			applyFlag = 0;
		this.applyFlag = applyFlag;
	}

	@Column(name = "etcomm_id")
	public String getEtcommID() {
		return etcommID;
	}

	public void setEtcommID(String etcommID) {
		this.etcommID = etcommID;
	}

	public String getExtendInfo() {
		return extendInfo;
	}

	public void setExtendInfo(String extendInfo) {
		this.extendInfo = extendInfo;
	}

	@Column(name = "name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "phone")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "email")
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "weixin")
	public String getWeixin() {
		return weixin;
	}

	public void setWeixin(String weixin) {
		this.weixin = weixin;
	}

	@Column(name = "address")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "birthday")
	public Integer getBirthday() {
		return birthday;
	}

	public void setBirthday(Integer birthday) {
		this.birthday = birthday;
	}

	@Column(name = "age")
	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Column(name = "qq")
	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	@Column(name = "is_allocated")
	public Short getIsAllocated() {
		return isAllocated;
	}

	public void setIsAllocated(Short isAllocated) {
		this.isAllocated = isAllocated;
	}

	@Column(name = "create_time")
	public Integer getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Integer createTime) {
		this.createTime = createTime;
	}

	@Column(name = "update_time")
	public Integer getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Integer updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "accountMoney")
	public String getAccountMoney() {
		return accountMoney;
	}

	public void setAccountMoney(String accountMoney) {
		this.accountMoney = accountMoney;
	}

	@Column(name = "accountDeposit")
	public String getActualDeposit() {
		return actualDeposit;
	}

	public void setActualDeposit(String actualDeposit) {
		this.actualDeposit = actualDeposit;
	}

	@Column(name = "actualPrice")
	public String getActualPrice() {
		return actualPrice;
	}

	public void setActualPrice(String actualPrice) {
		this.actualPrice = actualPrice;
	}

	@Column(name = "bedMatID")
	public String getBedMatID() {
		return bedMatID;
	}

	public void setBedMatID(String bedMatID) {
		this.bedMatID = bedMatID;
	}

	@Column(name = "cardCodeScanning")
	public String getCardCodeScanning() {
		return cardCodeScanning;
	}

	public void setCardCodeScanning(String cardCodeScanning) {
		this.cardCodeScanning = cardCodeScanning;
	}

	@Column(name = "changePriceFlag")
	public Short getChangePriceFlag() {
		return changePriceFlag;
	}

	public void setChangePriceFlag(Short changePriceFlag) {
		if (changePriceFlag == null)
			changePriceFlag = 0;
		this.changePriceFlag = changePriceFlag;
	}

	@Column(name = "checkInDate")
	public Integer getCheckInDate() {
		return checkInDate;
	}

	public void setCheckInDate(Integer checkInDate) {
		this.checkInDate = checkInDate;
	}

	@Column(name = "checkOutDate")
	public Integer getCheckOutDate() {
		return checkOutDate;
	}

	public void setCheckOutDate(Integer checkOutDate) {
		this.checkOutDate = checkOutDate;
	}

	@Column(name = "contractEndDate")
	public Integer getContractEndDate() {
		return contractEndDate;
	}

	public void setContractEndDate(Integer contractEndDate) {
		this.contractEndDate = contractEndDate;
	}

	@Column(name = "contractNO")
	public String getContractNO() {
		return contractNO;
	}

	public void setContractNO(String contractNO) {
		this.contractNO = contractNO;
	}

	@Column(name = "contractStartDate")
	public Integer getContractStartDate() {
		return contractStartDate;
	}

	public void setContractStartDate(Integer contractStartDate) {
		this.contractStartDate = contractStartDate;
	}

	@Column(name = "countDate")
	public Integer getCountDate() {
		return countDate;
	}

	public void setCountDate(Integer countDate) {
		this.countDate = countDate;
	}

	@Column(name = "cardCode")
	public String getCardCode() {
		return cardCode;
	}

	public void setCardCode(String cardCode) {
		this.cardCode = cardCode;
	}

	@Column(name = "customerCharacter")
	public String getCustomerCharacter() {
		return customerCharacter;
	}

	public void setCustomerCharacter(String customerCharacter) {
		this.customerCharacter = customerCharacter;
	}

	@Column(name = "customerCustom")
	public String getCustomerCustom() {
		return customerCustom;
	}

	public void setCustomerCustom(String customerCustom) {
		this.customerCustom = customerCustom;
	}

	@Column(name = "customerDiet")
	public String getCustomerDiet() {
		return customerDiet;
	}

	public void setCustomerDiet(String customerDiet) {
		this.customerDiet = customerDiet;
	}

	@JsonApiToOne
	@JsonApiLookupIncludeAutomatically
	@Fetch(FetchMode.SELECT)
	// huibati
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "firstRelation_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getFirstRelation() {
		return firstRelation;
	}

	public void setFirstRelation(Dicttype firstRelation) {
		this.firstRelation = firstRelation;
	}

	@Column(name = "customerHobby")
	public String getCustomerHobby() {
		return customerHobby;
	}

	public void setCustomerHobby(String customerHobby) {
		this.customerHobby = customerHobby;
	}

	@JsonApiToOne
	@JsonApiLookupIncludeAutomatically
	@Fetch(FetchMode.SELECT)
	// huibati
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "native_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getCustomerNative() {
		return customerNative;
	}

	public void setCustomerNative(Dicttype customerNative) {
		this.customerNative = customerNative;
	}

	@Column(name = "customerPS")
	public String getCustomerPS() {
		return customerPS;
	}

	public void setCustomerPS(String customerPS) {
		this.customerPS = customerPS;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "secondRelation_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getSecondRelation() {
		return secondRelation;
	}

	public void setSecondRelation(Dicttype secondRelation) {
		this.secondRelation = secondRelation;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "thirdRelation_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getThirdRelation() {
		return thirdRelation;
	}

	public void setThirdRelation(Dicttype thirdRelation) {
		this.thirdRelation = thirdRelation;
	}

	@Column(name = "deposit")
	public String getDeposit() {
		return deposit;
	}

	public void setDeposit(String deposit) {
		this.deposit = deposit;
	}

	@Column(name = "experienceDate")
	public Integer getExperienceDate() {
		return experienceDate;
	}

	public void setExperienceDate(Integer experienceDate) {
		this.experienceDate = experienceDate;
	}

	@Column(name = "experienceEndDate")
	public String getExperienceEndDate() {
		return experienceEndDate;
	}

	public void setExperienceEndDate(String experienceEndDate) {
		this.experienceEndDate = experienceEndDate;
	}

	@Column(name = "experienceStartDate")
	public String getExperienceStartDate() {
		return experienceStartDate;
	}

	public void setExperienceStartDate(String experienceStartDate) {
		this.experienceStartDate = experienceStartDate;
	}

	@Column(name = "guardianFirstAddress")
	public String getGuardianFirstAddress() {
		return guardianFirstAddress;
	}

	public void setGuardianFirstAddress(String guardianFirstAddress) {
		this.guardianFirstAddress = guardianFirstAddress;
	}

	@Column(name = "guardianFirstCardCode")
	public String getGuardianFirstCardCode() {
		return guardianFirstCardCode;
	}

	public void setGuardianFirstCardCode(String guardianFirstCardCode) {
		this.guardianFirstCardCode = guardianFirstCardCode;
	}

	@Column(name = "guardianFirstCardCodeScanning")
	public String getGuardianFirstCardCodeScanning() {
		return guardianFirstCardCodeScanning;
	}

	public void setGuardianFirstCardCodeScanning(String guardianFirstCardCodeScanning) {
		this.guardianFirstCardCodeScanning = guardianFirstCardCodeScanning;
	}

	@Column(name = "guardianFirstContact")
	public String getGuardianFirstContact() {
		return guardianFirstContact;
	}

	public void setGuardianFirstContact(String guardianFirstContact) {
		this.guardianFirstContact = guardianFirstContact;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "guardianFirstGener_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getGuardianFirstGener() {
		return guardianFirstGener;
	}

	public void setGuardianFirstGener(Dicttype guardianFirstGener) {
		this.guardianFirstGener = guardianFirstGener;
	}

	@Column(name = "guardianFirstName")
	public String getGuardianFirstName() {
		return guardianFirstName;
	}

	public void setGuardianFirstName(String guardianFirstName) {
		this.guardianFirstName = guardianFirstName;
	}

	@Column(name = "guardianFirstWork")
	public String getGuardianFirstWork() {
		return guardianFirstWork;
	}

	public void setGuardianFirstWork(String guardianFirstWork) {
		this.guardianFirstWork = guardianFirstWork;
	}

	@Column(name = "guardianSecondAddress")
	public String getGuardianSecondAddress() {
		return guardianSecondAddress;
	}

	public void setGuardianSecondAddress(String guardianSecondAddress) {
		this.guardianSecondAddress = guardianSecondAddress;
	}

	@Column(name = "guardianSecondCardCode")
	public String getGuardianSecondCardCode() {
		return guardianSecondCardCode;
	}

	public void setGuardianSecondCardCode(String guardianSecondCardCode) {
		this.guardianSecondCardCode = guardianSecondCardCode;
	}

	@Column(name = "guardianSecondCardCodeScanning")
	public String getGuardianSecondCardCodeScanning() {
		return guardianSecondCardCodeScanning;
	}

	public void setGuardianSecondCardCodeScanning(String guardianSecondCardCodeScanning) {
		this.guardianSecondCardCodeScanning = guardianSecondCardCodeScanning;
	}

	@Column(name = "guardianSecondContact")
	public String getGuardianSecondContact() {
		return guardianSecondContact;
	}

	public void setGuardianSecondContact(String guardianSecondContact) {
		this.guardianSecondContact = guardianSecondContact;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "guardianSecondGener_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getGuardianSecondGener() {
		return guardianSecondGener;
	}

	public void setGuardianSecondGener(Dicttype guardianSecondGener) {
		this.guardianSecondGener = guardianSecondGener;
	}

	@Column(name = "guardianSecondName")
	public String getGuardianSecondName() {
		return guardianSecondName;
	}

	public void setGuardianSecondName(String guardianSecondName) {
		this.guardianSecondName = guardianSecondName;
	}

	@Column(name = "guardianSecondWork")
	public String getGuardianSecondWork() {
		return guardianSecondWork;
	}

	public void setGuardianSecondWork(String guardianSecondWork) {
		this.guardianSecondWork = guardianSecondWork;
	}

	@Column(name = "guardianThirdAddress")
	public String getGuardianThirdAddress() {
		return guardianThirdAddress;
	}

	public void setGuardianThirdAddress(String guardianThirdAddress) {
		this.guardianThirdAddress = guardianThirdAddress;
	}

	@Column(name = "guardianThirdCardCode")
	public String getGuardianThirdCardCode() {
		return guardianThirdCardCode;
	}

	public void setGuardianThirdCardCode(String guardianThirdCardCode) {
		this.guardianThirdCardCode = guardianThirdCardCode;
	}

	@Column(name = "guardianThirdCardCodeScanning")
	public String getGuardianThirdCardCodeScanning() {
		return guardianThirdCardCodeScanning;
	}

	public void setGuardianThirdCardCodeScanning(String guardianThirdCardCodeScanning) {
		this.guardianThirdCardCodeScanning = guardianThirdCardCodeScanning;
	}

	@Column(name = "guardianThirdContact")
	public String getGuardianThirdContact() {
		return guardianThirdContact;
	}

	public void setGuardianThirdContact(String guardianThirdContact) {
		this.guardianThirdContact = guardianThirdContact;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "guardianThirdGener_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getGuardianThirdGener() {
		return guardianThirdGener;
	}

	public void setGuardianThirdGener(Dicttype guardianThirdGener) {
		this.guardianThirdGener = guardianThirdGener;
	}

	@Column(name = "guardianThirdName")
	public String getGuardianThirdName() {
		return guardianThirdName;
	}

	public void setGuardianThirdName(String guardianThirdName) {
		this.guardianThirdName = guardianThirdName;
	}

	@Column(name = "guardianThirdWork")
	public String getGuardianThirdWork() {
		return guardianThirdWork;
	}

	public void setGuardianThirdWork(String guardianThirdWork) {
		this.guardianThirdWork = guardianThirdWork;
	}

	@Column(name = "hbeaconID")
	public String getHbeaconID() {
		return hbeaconID;
	}

	public void setHbeaconID(String hbeaconID) {
		this.hbeaconID = hbeaconID;
	}

	@Column(name = "healthReportsScanning")
	public String getHealthReportsScanning() {
		return healthReportsScanning;
	}

	public void setHealthReportsScanning(String healthReportsScanning) {
		this.healthReportsScanning = healthReportsScanning;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "nationality_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getNationality() {
		return nationality;
	}

	public void setNationality(Dicttype nationality) {
		this.nationality = nationality;
	}

	@Column(name = "referencePrice")
	public String getReferencePrice() {
		return referencePrice;
	}

	public void setReferencePrice(String referencePrice) {
		this.referencePrice = referencePrice;
	}

	@Column(name = "selfCareAbilityResult")
	public String getSelfCareAbilityResult() {
		return selfCareAbilityResult;
	}

	public void setSelfCareAbilityResult(String selfCareAbilityResult) {
		this.selfCareAbilityResult = selfCareAbilityResult;
	}

	@Column(name = "headImg")
	public String getHeadImg() {
		return headImg;
	}

	public void setHeadImg(String headImg) {
		this.headImg = headImg;
	}

	@Column(name = "ref_bed_price")
	public String getReferenceBedPrice() {
		return referenceBedPrice;
	}

	public void setReferenceBedPrice(String referenceBedPrice) {
		this.referenceBedPrice = referenceBedPrice;
	}

	@Column(name = "actual_bed_price")
	public String getActualBedPrice() {
		return actualBedPrice;
	}

	public void setActualBedPrice(String actualBedPrice) {
		this.actualBedPrice = actualBedPrice;
	}

	@Column(name = "ref_dining_price")
	public String getReferenceDiningPrice() {
		return referenceDiningPrice;
	}

	public void setReferenceDiningPrice(String referenceDiningPrice) {
		this.referenceDiningPrice = referenceDiningPrice;
	}

	@Column(name = "actual_dining_price")
	public String getActualDiningPrice() {
		return actualDiningPrice;
	}

	public void setActualDiningPrice(String actualDiningPrice) {
		this.actualDiningPrice = actualDiningPrice;
	}

	@Column(name = "ref_nursing_price")
	public String getReferenceNursingPrice() {
		return referenceNursingPrice;
	}

	public void setReferenceNursingPrice(String referenceNursingPrice) {
		this.referenceNursingPrice = referenceNursingPrice;
	}

	@Column(name = "actual_nursing_price")
	public String getActualNursingPrice() {
		return actualNursingPrice;
	}

	public void setActualNursingPrice(String actualNursingPrice) {
		this.actualNursingPrice = actualNursingPrice;
	}

	@Column(name = "detailed_information")
	public String getDetailedInformation() {
		return detailedInformation;
	}

	public void setDetailedInformation(String detailedInformation) {
		this.detailedInformation = detailedInformation;
	}

	@Column(name = "taboo_thing")
	public String getTabooThing() {
		return tabooThing;
	}

	public void setTabooThing(String tabooThing) {
		this.tabooThing = tabooThing;
	}

	@Column(name = "import_person")
	public String getImportancePerson() {
		return importancePerson;
	}

	public void setImportancePerson(String importancePerson) {
		this.importancePerson = importancePerson;
	}

	@Column(name = "import_thing")
	public String getImportanceThing() {
		return importanceThing;
	}

	public void setImportanceThing(String importanceThing) {
		this.importanceThing = importanceThing;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "sex_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getSex() {
		return sex;
	}

	public void setSex(Dicttype sex) {
		this.sex = sex;
	}

	@JsonApiToOne
	@JsonApiLookupIncludeAutomatically(overwrite = true)
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JoinColumn(name = "bed_id", foreignKey = @ForeignKey(name = "null"))
	public Bed getBed() {
		return bed;
	}

	public void setBed(Bed bed) {
		this.bed = bed;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "createuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getCreateUser() {
		return createUser;
	}

	public void setCreateUser(User createUser) {
		this.createUser = createUser;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "lastupdateuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getLastUpdateUser() {
		return lastUpdateUser;
	}

	public void setLastUpdateUser(User lastUpdateUser) {
		this.lastUpdateUser = lastUpdateUser;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "bloodtype_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getBloodType() {
		return bloodType;
	}

	public void setBloodType(Dicttype bloodType) {
		this.bloodType = bloodType;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "diningStandard_id", foreignKey = @ForeignKey(name = "null"))
	public DicttypeTenant getDiningStandard() {
		return diningStandard;
	}

	public void setDiningStandard(DicttypeTenant diningStandard) {
		this.diningStandard = diningStandard;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "expenceType_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getExpenceType() {
		return expenceType;
	}

	public void setExpenceType(Dicttype expenceType) {
		this.expenceType = expenceType;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "educationLevel_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getEducationLevel() {
		return educationLevel;
	}

	public void setEducationLevel(Dicttype educationLevel) {
		this.educationLevel = educationLevel;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "selfCareAbility_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getSelfCareAbility() {
		return selfCareAbility;
	}

	public void setSelfCareAbility(Dicttype selfCareAbility) {
		this.selfCareAbility = selfCareAbility;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "customerStatus_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getCustomerStatus() {
		return customerStatus;
	}

	public void setCustomerStatus(Dicttype customerStatus) {
		this.customerStatus = customerStatus;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "incomeType_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getIncomeType() {
		return incomeType;
	}

	public void setIncomeType(Dicttype incomeType) {
		this.incomeType = incomeType;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "maritalStatus_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getMaritalStatus() {
		return maritalStatus;
	}

	public void setMaritalStatus(Dicttype maritalStatus) {
		this.maritalStatus = maritalStatus;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "nursingGrade_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getNursingGrade() {
		return nursingGrade;
	}

	public void setNursingGrade(Dicttype nursingGrade) {
		this.nursingGrade = nursingGrade;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "religion_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getReligion() {
		return religion;
	}

	public void setReligion(Dicttype religion) {
		this.religion = religion;
	}

	@JsonApiToMany
	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY, mappedBy = "customer")
	public List<CustomerDrug> getDrugs() {
		return drugs;
	}

	public void setDrugs(List<CustomerDrug> drugs) {
		this.drugs = drugs;
	}

	@JsonApiToMany
	@ManyToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
	@JoinTable(name = "tnb_employee_customer", joinColumns = { @JoinColumn(name = "customer_id",
			nullable = false, updatable = false, foreignKey = @ForeignKey(name = "null")) },
			inverseJoinColumns = { @JoinColumn(name = "employee_id", nullable = false,
					updatable = false, foreignKey = @ForeignKey(name = "null")) })
	public List<Employee> getEmployees() {
		return employees;
	}

	public void setEmployees(List<Employee> employees) {
		this.employees = employees;
	}

	@JsonApiToMany
	@ManyToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
	@JoinTable(name = "tnb_staff_customer", joinColumns = { @JoinColumn(name = "customer_id",
			nullable = false, updatable = false, foreignKey = @ForeignKey(name = "null")) },
			inverseJoinColumns = { @JoinColumn(name = "staff_id", nullable = false,
					updatable = false, foreignKey = @ForeignKey(name = "null")) })
	public List<User> getStaffs() {
		return staffs;
	}

	public void setStaffs(List<User> staffs) {
		this.staffs = staffs;
	}

	@JsonApiLookupIncludeAutomatically
	@JsonApiToMany
	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY, mappedBy = "examUser")
	public List<HealthInfo> getHealthInfos() {
		return healthInfos;
	}

	public void setHealthInfos(List<HealthInfo> healthInfos) {
		this.healthInfos = healthInfos;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "birthday_habit", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getCustomerBirthdayHabit() {
		return customerBirthdayHabit;
	}

	public void setCustomerBirthdayHabit(Dicttype customerBirthdayHabit) {
		this.customerBirthdayHabit = customerBirthdayHabit;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	// huibati
	@JoinColumn(name = "medical_insurance_type", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getMedicalInsuranceCategory() {
		return medicalInsuranceCategory;
	}

	public void setMedicalInsuranceCategory(Dicttype medicalInsuranceCategory) {
		this.medicalInsuranceCategory = medicalInsuranceCategory;
	}

	@JsonApiToMany
	@JsonApiIncludeByDefault
	@ManyToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
	@JoinTable(name = "tnb_customer_type", joinColumns = { @JoinColumn(name = "customer_id",
			nullable = false, updatable = false, foreignKey = @ForeignKey(name = "null")) },
			inverseJoinColumns = { @JoinColumn(name = "type_id", nullable = false,
					updatable = false, foreignKey = @ForeignKey(name = "null")) })
	@Fetch(FetchMode.JOIN)
	public List<Dicttype> getOldManType() {
		return oldManType;
	}

	public void setOldManType(List<Dicttype> oldManType) {
		this.oldManType = oldManType;
	}

	@Transient
	public String getDiscountRate() {
		if (this.referencePrice != null && this.actualPrice != null) {
			double referencePrice = Double.parseDouble(this.referencePrice);
			double actualPrice = Double.parseDouble(this.actualPrice);
			this.discountRate = Double.toString((-actualPrice + referencePrice) * 100
					/ referencePrice)
					+ "%";
		} else
			this.discountRate = "";
		return discountRate;
	}

	public void setDiscountRate(String discountRate) {
		this.discountRate = discountRate;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@OneToOne(optional = true, cascade = CascadeType.REFRESH, mappedBy = "customer")
	public CustomerVipInfo getCustomerVipInfo() {
		return customerVipInfo;
	}

	public void setCustomerVipInfo(CustomerVipInfo customerVipInfo) {
		this.customerVipInfo = customerVipInfo;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	@JoinColumn(name = "income_level_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getIncomeLevel() {
		return incomeLevel;
	}

	public void setIncomeLevel(Dicttype incomeLevel) {
		this.incomeLevel = incomeLevel;
	}

	@Column(name = "children_num")
	public Integer getChildrenNum() {
		return childrenNum;
	}

	public void setChildrenNum(Integer childrenNum) {
		this.childrenNum = childrenNum;
	}

	@Column(name = "bus_insurance_amount")
	public Integer getBusInsuranceAmount() {
		return busInsuranceAmount;
	}

	public void setBusInsuranceAmount(Integer busInsuranceAmount) {
		this.busInsuranceAmount = busInsuranceAmount;
	}

	@Transient
	public Integer getLeaveStatus() {
		return leaveStatus;
	}

	public void setLeaveStatus(Integer leaveStatus) {
		this.leaveStatus = leaveStatus;
	}

	@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH, mappedBy = "customer")
	@Fetch(FetchMode.JOIN)
	@JsonApiToOne
	@JsonApiIncludeByDefault
	public CustomerExtend getCustomerExtend() {
		return customerExtend;
	}

	public void setCustomerExtend(CustomerExtend customerExtend) {
		this.customerExtend = customerExtend;
	}

	@Transient
	public String getNursingLevel() {
		return nursingLevel;
	}

	public void setNursingLevel(String nursingLevel) {
		this.nursingLevel = nursingLevel;
	}

}
